﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Collections;

using SBPweb.PROvibe.Client.Framework.Contracts.Content;
using SBPweb.PROvibe.Client.Framework.Utilities.Animations;

namespace SBPweb.PROvibe.Client.Modules.Themes
{

    public partial class BlueTheme : IEnumerable, ITheme
    {

        public BlueTheme()
        {
            InitializeComponent();
        }

        #region IEnumerable<string> Members

        IEnumerator IEnumerable.GetEnumerator()
        {
            return new string[]{
                "ButtonEnter",
                "ButtonLeave",
                "ContainerEnter",
                "ContainerLeave",
                "ContainerShow",
                "ContainerHide",
                "NormalButton",
                "NormalContainer",
                "NormalContextMenu",
                "BackgroundGrid",
                "LoaderSplash",
                "ClockFace",
                "MarkersBig",
                "MarkersSmall"
            }.GetEnumerator();
        }

        #endregion

        public string Name
        {
            get
            {
                return this.GetType().Name;
            }
        }

        public void NormalButton_MouseEnter(object sender, MouseEventArgs e)
        {
            StoryboardHelper.BeginElementStoryBoard(sender as UIElement, "ButtonRHover", "ButtonEnter", new PropertyPath("Opacity"));
        }

        private void NormalButton_MouseLeave(object sender, MouseEventArgs e)
        {
            StoryboardHelper.BeginElementStoryBoard(sender as UIElement, "ButtonRHover", "ButtonLeave", new PropertyPath("Opacity"));
        }

        public void NormalContainer_MouseEnter(object sender, MouseEventArgs e)
        {
            StoryboardHelper.BeginElementStoryBoard(sender as UIElement, "ContainerRHover", "ContainerEnter", new PropertyPath("Opacity"));
        }

        private void NormalContainer_MouseLeave(object sender, MouseEventArgs e)
        {
            StoryboardHelper.BeginElementStoryBoard(sender as UIElement, "ContainerRHover", "ContainerLeave", new PropertyPath("Opacity"));
        }

        private void Button_IsEnabledChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            Button b = sender as Button;
            if (!b.IsEnabled)
            {
                b.Opacity = 0.2;
            }
            else
            {
                b.Opacity = 1.0;
            }
        }

    }

}